home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / enigma / earcd / emula / arosdv19.lha / AROS / dos / vfprintf.c < prev    next >
C/C++ Source or Header  |  1996-10-24  |  2KB  |  107 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: vfprintf.c,v 1.5 1996/10/24 15:50:38 aros Exp $
  4.     $Log: vfprintf.c,v $
  5.     Revision 1.5  1996/10/24 15:50:38  aros
  6.     Use the official AROS macros over the __AROS versions.
  7.  
  8.     Revision 1.4  1996/09/13 17:50:09  digulla
  9.     Use IPTR
  10.  
  11.     Revision 1.3  1996/08/13 13:52:52  digulla
  12.     Replaced <dos/dosextens.h> by "dos_intern.h" or added "dos_intern.h"
  13.     Replaced AROS_LA by AROS_LHA
  14.  
  15.     Revision 1.2  1996/08/01 17:40:59  digulla
  16.     Added standard header for all files
  17.  
  18.     Desc:
  19.     Lang: english
  20. */
  21. #include <clib/exec_protos.h>
  22. #include <dos/dosextens.h>
  23. #include <dos/filesystem.h>
  24. #include <clib/dos_protos.h>
  25. #include <aros/asmcall.h>
  26. #include "dos_intern.h"
  27.  
  28. AROS_UFH2(void,vfp_hook,
  29.     AROS_UFHA(UBYTE,        chr, D0),
  30.     AROS_UFHA(struct vfp *, vfp, A3)
  31. )
  32. {
  33.     AROS_LIBFUNC_INIT
  34.     extern struct DosLibrary *DOSBase;
  35.     if(vfp->count>=0)
  36.     {
  37.     if(FPUTC(vfp->file,chr)<0)
  38.     {
  39.         vfp->count=-1;
  40.         return;
  41.     }
  42.     vfp->count++;
  43.     }
  44.     AROS_LIBFUNC_EXIT
  45. }
  46.  
  47. /*****************************************************************************
  48.  
  49.     NAME */
  50.     #include <clib/dos_protos.h>
  51.  
  52.     AROS_LH3(LONG, VFPrintf,
  53.  
  54. /*  SYNOPSIS */
  55.     AROS_LHA(BPTR,   file,     D1),
  56.     AROS_LHA(STRPTR, format,   D2),
  57.     AROS_LHA(IPTR *, argarray, D3),
  58.  
  59. /*  LOCATION */
  60.     struct DosLibrary *, DOSBase, 59, Dos)
  61.  
  62. /*  FUNCTION
  63.  
  64.     INPUTS
  65.  
  66.     RESULT
  67.  
  68.     NOTES
  69.  
  70.     EXAMPLE
  71.  
  72.     BUGS
  73.  
  74.     SEE ALSO
  75.  
  76.     INTERNALS
  77.  
  78.     HISTORY
  79.     29-10-95    digulla automatically created from
  80.                 dos_lib.fd and clib/dos_protos.h
  81.  
  82. *****************************************************************************/
  83. {
  84.     AROS_LIBFUNC_INIT
  85.     AROS_LIBBASE_EXT_DECL(struct DosLibrary *,DOSBase)
  86.  
  87.     struct vfp vfp;
  88.  
  89.     vfp.file=file;
  90.     vfp.count=0;
  91.  
  92.     (void) RawDoFmt (format,
  93.     argarray,
  94.     (VOID_FUNC)AROS_ASMFUNC_NAME(vfp_hook),
  95.     &vfp
  96.     );
  97.  
  98.     /* Remove the last character (which is a NUL character) */
  99.     if(vfp.count>0)
  100.     {
  101.     vfp.count--;
  102.     ((struct FileHandle *)BADDR(file))->fh_Pos--;
  103.     }
  104.     return vfp.count;
  105.     AROS_LIBFUNC_EXIT
  106. } /* VFPrintf */
  107.